import torch

x = torch.tensor(3.0, requires_grad=True)
print(x)
y= x**2
print(y)
a = y.detach().numpy()
print(a)
# 阻断梯度
y.backward()
print(y)
with torch.no_grad():
    z = y**3
print(z)
